export default {
  computed: {
    columns() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "能耗项编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "能耗项名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "brevity",
          title: {
            "zh-CN": "能耗项简码",
            "en-US": "brevity",
          }[this.G_Locale],
          minWidth: 70,
          align: "center",
          show: true,
        },
        {
          key: "remark",
          title: {
            "zh-CN": "备注",
            "en-US": "remark",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
      ];
    },
    // form中列字段
    formColumns() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "能耗项编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "" },
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "能耗项名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "brevity",
          title: {
            "zh-CN": "能耗项简码",
            "en-US": "brevity",
          }[this.G_Locale],
          minWidth: 70,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "remark",
          title: {
            "zh-CN": "备注",
            "en-US": "remark",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "textarea" },
        },
      ];
    },
    //新增框中字段，去掉编码
    addFormColumns(){
      let addFormColumns = this.tools.lodash.cloneDeep(this.formColumns)
      let index = addFormColumns.findIndex(d=>d.key==='sf_code')
      addFormColumns.splice(index,1)
      return addFormColumns
    },
    lang () {
        return {
            'en-US': {
                confirmDelete: 'confirm delete',
                cancel: 'cancel'
            },
            'zh-CN': {
                confirmDelete: '删除确认',
                cancel: '取消'
            }
        }[this.G_Locale];
    },
  },
};
